﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Maticsoft.BLL;
using Maticsoft.Model;

namespace FineUI.Examples
{
    public partial class major_updateAdminInfo : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Maticsoft.BLL.major majorinfo = new Maticsoft.BLL.major();
                admininfo.DataSource = majorinfo.selectAllAdminInfo();
                admininfo.DataBind();
            }
        }
        public void btn_del(Object sender, CommandEventArgs e)
        {
            //Response.Write(e.CommandArgument);
            int admin_id = int.Parse((string)e.CommandArgument);
            //Response.Write(keCheng_id);
            Maticsoft.BLL.major majorinfo = new Maticsoft.BLL.major();
            bool aaa = majorinfo.DeleteAdminInfo(admin_id);
            admininfo.DataSource = majorinfo.selectAllAdminInfo();
            admininfo.DataBind();
            if (aaa)
            {
                Page.ClientScript.RegisterStartupScript(Page.GetType(), "message", "<script language='javascript' defer>alert('删除成功，请刷新页面信息！');</script>");
            }
            else
            {
                Page.ClientScript.RegisterStartupScript(Page.GetType(), "message", "<script language='javascript' defer>alert('删除成功，请刷新页面信息！');</script>");
            }
        }
    }
}